Portfolio Project 1

Posing and answering research questions

library(tidyverse)
library(tidytuesdayR)

Overview

In your first portfolio project, you’ll explore a dataset and pose your own research question. You’ll then apply what you’ve learned about ggplot2 and design principles to answer the question.

Your final report should include

  1. A paragraph introduction to your data
  2. A section discussing your research question that includes:
    • An explicit statement of your question
    • Why that question is interesting/important
    • What you expect your answer to be to this question and why (this should be argued BEFORE digging deeply into the data; it’s okay if you find out you were wrong!)
    • A graph that answers the question (or multiple, if more than one best answers the question)
    • A written answer to the question based on the graph(s), including whether your expectation was proven right or wrong
  3. A section describing your design choices, including
    • A paragraph telling me why you chose the geometries, aesthetics, scales, themes, etc. that you did
    • A brief reflection on whether it is possible other choices may have been valid as well, and whether changes there may have impacted your conclusions. You do NOT need to create other visuals to answer this part, but instead merely reflect in words.

Your question should involve at least two variables to answer. You should phrase the question in a way that is within the scope of inference of your data. For example, if you have an observational dataset, you shouldn’t phrase your question in a causal way. Your questions shouldn’t be identical to the example questions in the TidyTuesday repo pages.

Your rendered file should not echo the code used to create the graphs, but the code in your .qmd should be clean and readable. Your report should not be long! If rendering to a PDF, I expect the entire report to be maybe 2-3 pages.

Options

1. World Languages

endangered_status <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-12-23/endangered_status.csv")
families <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-12-23/families.csv")
languages <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-12-23/languages.csv")
# Download raw data and filter to endangered status
endangered_status <- 
  readr::read_csv("https://raw.githubusercontent.com/glottolog/glottolog-cldf/refs/heads/master/cldf/values.csv") |> 
  dplyr::filter(Parameter_ID == "aes") |> 
  dplyr::select(Language_ID, Value, Code_ID) |> 
  dplyr::rename(id = Language_ID,
                status_code = Value,
                status_label = Code_ID) |> 
  dplyr::mutate(status_label = stringr::str_replace(stringr::str_remove(status_label, "^aes-"), "_", " "))

# Download language and family data
fam_lgs <- 
  readr::read_csv("https://raw.githubusercontent.com/glottolog/glottolog-cldf/refs/heads/master/cldf/languages.csv")

# Filter and clean language family data
families <- 
  fam_lgs |> 
  dplyr::filter(Level == "family") |> 
  dplyr::select(ID, Name) |> 
  dplyr::rename(Family = Name) |> 
  dplyr::rename_with(stringr::str_to_lower, dplyr::everything())

# Filter and clean language data
languages <- 
  fam_lgs |> 
  dplyr::filter(Level == "language") |> 
  dplyr::select(ID, Name, Macroarea, Latitude, Longitude, ISO639P3code, Countries, Is_Isolate, Family_ID) |> 
  dplyr::rename_with(stringr::str_to_lower, dplyr::everything())

# Merge datasets together
languages <- merge(languages, endangered_status, by="id")
languages <- merge(languages, families, by.x="family_id", by.y="id")

glimpse(languages)
Rows: 8,059
Columns: 12
$ family_id    <chr> "abkh1242", "abkh1242", "abkh1242", "abkh1242", "abkh1242…
$ id           <chr> "ubyk1235", "adyg1241", "kaba1278", "abkh1244", "abaz1241…
$ name         <chr> "Ubykh", "West Circassian", "Kabardian", "Abkhaz", "Abaza…
$ macroarea    <chr> "Eurasia", "Eurasia", "Eurasia", "Eurasia", "Eurasia", "A…
$ latitude     <dbl> 43.670000, 44.000000, 43.508200, 43.056218, 44.250000, 13…
$ longitude    <dbl> 39.67000, 39.33000, 43.39180, 41.15911, 42.00000, 4.47692…
$ iso639p3code <chr> "uby", "ady", "kbd", "abk", "abq", "ttq", "kwl", "tzm", "…
$ countries    <chr> "TR", "IL;JO;RU;SY;TR", "RU;TR", "GE;RU;TR", "RU;TR", "BF…
$ is_isolate   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, F…
$ status_code  <chr> "6", "2", "2", "2", "2", "1", "1", "2", "2", "2", "3", "5…
$ status_label <chr> "extinct", "threatened", "threatened", "threatened", "thr…
$ family       <chr> "Abkhaz-Adyge", "Abkhaz-Adyge", "Abkhaz-Adyge", "Abkhaz-A…

For more information about the variables in the dataset, see the TidyTuesday repo page.

2. Olympics

olympics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2026/2026-02-10/schedule.csv')
olympics
# A tibble: 1,866 × 21
   date       discipline_code discipline_name event_code       event_description
   <date>     <chr>           <chr>           <chr>            <chr>            
 1 2026-02-04 ALP             Alpine Skiing   ALPMDH---------… Men's Downhill 1…
 2 2026-02-04 ALP             Alpine Skiing   ALPMDH---------… Men's Downhill 2…
 3 2026-02-04 ALP             Alpine Skiing   ALPWDH---------… Women's Downhill…
 4 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
 5 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
 6 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
 7 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
 8 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
 9 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
10 2026-02-04 CUR             Curling         CURXTEAM2------… Mixed Doubles Ro…
# ℹ 1,856 more rows
# ℹ 16 more variables: start_datetime_local <dttm>, end_datetime_local <dttm>,
#   start_datetime_utc <dttm>, end_datetime_utc <dttm>, is_medal_event <lgl>,
#   is_training <lgl>, venue_code <chr>, venue_name <chr>, venue_slug <chr>,
#   location_name <chr>, location_code <chr>, session_code <chr>,
#   estimated_start <lgl>, day_of_week <chr>, start_time <time>,
#   end_time <time>

For more information about the variables in the dataset, see the TidyTuesday repo page.

3. NSF grant terminations

nsf_terminations <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-05-06/nsf_terminations.csv')
nsf_terminations
# A tibble: 1,041 × 21
   grant_number project_title termination_letter_d…¹ org_name org_city org_state
          <dbl> <chr>         <date>                 <chr>    <chr>    <chr>    
 1      2135329 Collaborativ… 2025-04-25             Univers… ALBUQUE… NM       
 2      2342099 MyTurn: An A… 2025-04-25             Univers… CHICAGO  IL       
 3      2201103 Collaborativ… 2025-04-25             America… WASHING… DC       
 4      2215382 Engaging Rur… 2025-04-25             TERC Inc CAMBRID… MA       
 5      2405633 Design Effec… 2025-04-25             San Fra… SAN FRA… CA       
 6      2317714 Collaborativ… 2025-04-25             Occiden… LOS ANG… CA       
 7      2046081 CAREER: SBP:… 2025-04-25             Univers… SANTA B… CA       
 8      2348705 Rural Commun… 2025-04-25             Hamilto… CLINTON  NY       
 9      2404708 Postdoctoral… 2025-04-25             New Yor… New York CA       
10      2215138 BRITE Girls … 2025-04-25             Florida… TALLAHA… FL       
# ℹ 1,031 more rows
# ℹ abbreviated name: ¹​termination_letter_date
# ℹ 15 more variables: org_district <chr>, usaspending_obligated <dbl>,
#   award_type <chr>, directorate_abbrev <chr>, directorate <chr>,
#   division <chr>, nsf_program_name <chr>, nsf_url <chr>,
#   usaspending_url <chr>, nsf_startdate <date>, nsf_expected_end_date <date>,
#   org_zip <chr>, org_uei <chr>, abstract <chr>, in_cruz_list <lgl>

For more information about the variables in the dataset, see the TidyTuesday repo page.

4. US Judges

judges_appointments <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-06-10/judges_appointments.csv')
judges_people <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-06-10/judges_people.csv')
judges <- merge(judges_appointments, judges_people, by="judge_id")

glimpse(judges)
Rows: 4,202
Columns: 27
$ judge_id                       <dbl> 1, 2, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, …
$ court_name                     <chr> "U. S. District Court, Eastern District…
$ court_type                     <chr> "USDC", "USDC", "USCC (1869)", "USCA", …
$ president_name                 <chr> "Franklin D. Roosevelt", "Rutherford B.…
$ president_party                <chr> "Democratic", "Republican", "Republican…
$ nomination_date                <chr> "02/03/1936", "01/06/1880", "01/23/1891…
$ predecessor_last_name          <chr> "new", "Ketcham", "McKennan", NA, "McFa…
$ predecessor_first_name         <chr> NA, "Winthrop", "William", NA, "Frank H…
$ senate_confirmation_date       <chr> "02/12/1936", "01/14/1880", "02/03/1891…
$ commission_date                <chr> "02/15/1936", "01/14/1880", "02/03/1891…
$ chief_judge_begin              <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ chief_judge_end                <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA,…
$ retirement_from_active_service <chr> "02/15/1966", NA, NA, NA, "05/31/1996",…
$ termination_date               <chr> "05/28/1971", "02/09/1891", "06/21/1906…
$ termination_reason             <chr> "Death", "Appointment to Another Judici…
$ name_first                     <chr> "Matthew", "Marcus", "Marcus", "Marcus"…
$ name_middle                    <chr> "T.", "Wilson", "Wilson", "Wilson", "Ma…
$ name_last                      <chr> "Abruzzo", "Acheson", "Acheson", "Aches…
$ name_suffix                    <chr> NA, NA, NA, NA, "Jr.", NA, NA, NA, NA, …
$ birth_date                     <dbl> 1889, 1828, 1828, 1828, 1927, 1928, 192…
$ birthplace_city                <chr> "Brooklyn", "Washington", "Washington",…
$ birthplace_state               <chr> "NY", "PA", "PA", "PA", "AL", "NJ", "FL…
$ death_date                     <dbl> 1971, 1906, 1906, 1906, NA, 2009, 1984,…
$ death_city                     <chr> "Potomac", "Pittsburgh", "Pittsburgh", …
$ death_state                    <chr> "MD", "PA", "PA", "PA", NA, "NJ", "IL",…
$ gender                         <chr> "M", "M", "M", "M", "M", "M", "M", "M",…
$ race                           <chr> "White", "White", "White", "White", "Wh…

For more information about the variables in the dataset, see the TidyTuesday repo page.

5. Dungeons and Dragons Monsters

dnd <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/refs/heads/main/data/2025/2025-05-27/monsters.csv')

dnd
# A tibble: 330 × 33
   name   category    cr size  type  descriptive_tags alignment    ac initiative
   <chr>  <chr>    <dbl> <chr> <chr> <chr>            <chr>     <dbl>      <dbl>
 1 Abole… Aboleth  10    Large Aber… <NA>             Lawful E…    17          7
 2 Air E… Air Ele…  5    Large Elem… <NA>             Neutral      15          5
 3 Anima… Animate…  1    Medi… Cons… <NA>             Unaligned    18          2
 4 Anima… Animate…  0.25 Small Cons… <NA>             Unaligned    17          4
 5 Anima… Animate…  2    Large Cons… <NA>             Unaligned    12          4
 6 Ankheg Ankheg    2    Large Mons… <NA>             Unaligned    14          0
 7 Assas… Assassin  8    Medi… Huma… <NA>             Neutral      16         10
 8 Awake… Awakene…  0    Small Plant <NA>             Neutral       9         -1
 9 Awake… Awakene…  2    Huge  Plant <NA>             Neutral      13         -2
10 Axe B… Axe Beak  0.25 Large Mons… <NA>             Unaligned    11          1
# ℹ 320 more rows
# ℹ 24 more variables: hp <chr>, hp_number <dbl>, speed <chr>,
#   speed_base_number <dbl>, str <dbl>, dex <dbl>, con <dbl>, int <dbl>,
#   wis <dbl>, cha <dbl>, str_save <dbl>, dex_save <dbl>, con_save <dbl>,
#   int_save <dbl>, wis_save <dbl>, cha_save <dbl>, skills <chr>,
#   resistances <chr>, vulnerabilities <chr>, immunities <chr>, gear <chr>,
#   senses <chr>, languages <chr>, full_text <chr>

For more information about the variables in the dataset, see the TidyTuesday repo page.

6. BYO

If none of the options listed here speak to you, you can also choose your own dataset. The data should have at least two quantitative and two categorical variables, at least eight variables total, and be “complicated” enough to demonstrate an advanced understanding of ggplot and design principles from class. I’d encourage you to run your idea by me before diving too deep!

Submission

Your submission should include at least one visualization, a written overview of your work, and all associated code. You should work in a quarto file and render to pdf. I will distribute GitHub skeleton repos that you should work within. You should commit and push your final code to GitHub. You’ll need to submit a pdf to Gradescope as well.

Rubric

A successful project will:

    • There should be at least two commits with substantial changes between the two
    • Very few grammatical mistakes, spelling mistakes, or typos
    • Appropriate labels and font sizes
    • A readable theme
    • The rendered document does not contain any unnecessary content (package loading messages, warnings, etc.)

An excellent project will meet all of the requirements for a successful project, plus

This is an individual portfolio project.